package com.cloudft.http.models;

/**
 * Class represents an Exception that the response was not successful.
 * This exception is throws by API service when synchronous request fails.
 * This exception is also passed to onFailure callback for asynchronous requests.
 *
 */
@SuppressWarnings("serial")
public class CFHttpException extends Exception {

	private int httpStatusCode;
	private String message;
	
	/**
	 * Default constructor
	 */
	public CFHttpException() {
	}
	
	/**
	 * Constructor - Sets given status code and the message.
	 * @param httpStatusCode
	 * @param message
	 */
	public CFHttpException(int httpStatusCode, String message) {
		setHttpStatusCode(httpStatusCode);
		setMessage(message);
	}
	
	/**
	 * Sets httpStatusCode
	 * @param httpStatusCode
	 */
	public void setHttpStatusCode(int httpStatusCode) {
		this.httpStatusCode = httpStatusCode;
	}
	
	/**
	 * Returns httpStatusCode
	 * @return
	 */
	public int getHttpStatusCode() {
		return httpStatusCode;
	}

	/**
	 * Sets message
	 * @param message
	 */
	public void setMessage(String message) {
		this.message = message;
	}

	/**
	 * Returns message
	 */
	public String getMessage() {
		return message;
	}
}
